import javax.swing.*;
import java.awt.*;

public class ChristmasTree extends JFrame {

    public ChristmasTree() {
        setTitle("Christmas Tree");
        setSize(400, 400);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setLocationRelativeTo(null);
        setVisible(true);
    }

    public void paint(Graphics g) {
        super.paint(g);
        int[] x = {200, 150, 250};
        int[] y = {50, 150, 150};
        g.setColor(new Color(139, 69, 19));
        g.fillPolygon(x, y, 3);

        g.setColor(Color.GREEN);
        g.fillOval(175, 100, 50, 50);
        g.fillOval(150, 125, 50, 50);
        g.fillOval(200, 125, 50, 50);
        g.fillOval(175, 150, 50, 50);
        g.fillOval(175, 125, 50, 50);
    }

    public static void main(String[] args) {
        new ChristmasTree();
    }
}
